package com.xintonghua.bussiness.adapter;

import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.xintonghua.base.adapter.BaseAdapter;
import com.xintonghua.bussiness.R;
import com.xintonghua.bussiness.bean.MessageBean;
import com.xintonghua.bussiness.util.GlideUtils;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 作者：wanxianyi
 * 时间：2018/1/11.
 * 包名：com.xintonghua.bussiness.adapter
 */

public class MessageeAdapter extends BaseAdapter<MessageBean, MessageeAdapter.CollegeViewHolder> {


    public MessageeAdapter(Activity mActivity, List<MessageBean> list) {
        super(mActivity, list);
    }

    @Override
    public CollegeViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.adapter_message, parent, false);
        return new CollegeViewHolder(view);
    }

    @Override
    public void onBindViewHolder(CollegeViewHolder holder, int position) {
        final MessageBean bean = list.get(position);
        holder.tvMsgType.setText(bean.getTitle());
        holder.tvMsgTime.setText(bean.getCreate_time());
        holder.tvMsgContent.setText(bean.getContent());
    }


    class CollegeViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.tv_msg_type)
        TextView tvMsgType;
        @BindView(R.id.tv_msg_time)
        TextView tvMsgTime;
        @BindView(R.id.tv_msg_content)
        TextView tvMsgContent;

        public CollegeViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
